# Contributor: Antoine Martin (ayakael) <dev@ayakael.net>
# Maintainer: Antoine Martin (ayakael) <dev@ayakael.net>
pkgname=py3-jsonpath-ng
_pyname="jsonpath-ng"
pkgver=1.7.0
pkgrel=0
arch="noarch"
pkgdesc="A final implementation of JSONPath for Python that aims to be standard compliant"
url="https://pypi.python.org/project/jsonpath-ng"
license="Apache-2.0"
depends="py3-ply"
makedepends="
	py3-setuptools
	py3-gpep517
	py3-wheel
	"
checkdepends="
	py3-pytest
	"
source="
	$pkgname-$pkgver.tar.gz::https://github.com/h2non/jsonpath-ng/archive/refs/tags/v$pkgver.tar.gz
	"
builddir="$srcdir"/$_pyname-$pkgver
subpackages="$pkgname-pyc"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest -v
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}
sha512sums="
5c5cd6b34ea97b17d4cb745c442b40391feb419a066c53469d62d479f13af23f4c6b1dcd1279d2c01a06494eea4e53cdbd617da0e6e48c240eb3565f5f5a4b23  py3-jsonpath-ng-1.7.0.tar.gz
"
